#ifndef QMYTHREAD_H
#define QMYTHREAD_H
#include <QThread>

//QThreadProducer用于掷骰子，但是去掉了开始暂停按钮，线程一启动就连续的掷骰子
class QThreadProducer : public QThread{
    Q_OBJECT
private:
    bool m_stop = false; //停止线程
protected:
    void run() Q_DECL_OVERRIDE;
public:
    QThreadProducer();
    void stopThread();
};

//QThreadConsumer用于读取骰子的次数和点数信息，并用发射信号的方式把数据传递出去
class QThreadConsumer : public QThread{
    Q_OBJECT
private:
    bool m_stop = false; //停止线程
protected:
    void run() Q_DECL_OVERRIDE;
public:
    QThreadConsumer();
signals:
    void newValue(int seq, int diceValue);

};

#endif // QMYTHREAD_H
